﻿@using ZhouYu.DreamTour.Web.Models;
@using ZhouYu.DreamTour.Model;
@{
    var UserInfo = UserInfoContext.userInfoContext.UserInfo;
}
<!DOCTYPE html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title>中国梦想游-会员注册页</title>
    <link href="~/css/style.css" rel="stylesheet" type="text/css" />
    <link href="~/css/common.css" rel="stylesheet" type="text/css" />
    <link href="~/layui-v2.5.4/layui/css/layui.css" />
    <script src="~/layui-v2.5.4/layui/layui.js"></script>
    <script src="~/layui-v2.5.4/layui/layui.all.js"></script>
    <link href="~/layui-v2.5.4/layui/css/layui.mobile.css" />
    <script type="text/javascript" src="~/js/jquery-1.9.1.min.js"></script>
    <script type="text/javascript" src="~/js/notiflix-1.3.0.min.js"></script>

    <style>
        /*发送验证码样式*/
        #sendCode {
            background: #ff6700;
            border: none;
            color: white;
            font-weight: 800;
            border-radius: 3px;
            padding: 1.5%;
            margin-left: 12%;
        }

        #SendEmail {
            background: #ff6700;
            border: none;
            color: white;
            font-weight: 800;
            border-radius: 3px;
            padding: 0.7%;
            margin-left: 3%;
        }
    </style>
</head>
<body>
    <div class="top_hw clearfix">
        <div class="top_h clearfix">
            <div class="top_hl"><span>欢迎来到中国梦想游，让你的梦想全程免费自由行！</span> 预定热线：<b>0571-63322269</b></div>
            <div class="top_hr">
                @if (UserInfo == null)
                {
                    <a href="/Home/User_Register">会员注册</a>
                    <span>|</span> <a href="/Home/User_Login">登录</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a>
                    @*<a>
                            欢迎你，来到新世界旅行网！
                        </a>*@
                }
                else
                {
                    <a href="/Home/User_Center">会员中心</a>
                    <span>|</span> <a href="#">梦想收藏</a> <span>|</span> <a href="#">设为首页</a> <span>|</span> <a href="/Login/LoginOut">退出</a> <span>|</span>
                    <a>
                        欢迎你，<span>@UserInfo.User_Name</span>来到新世界旅行网！
                    </a>
                }
            </div>
        </div>
    </div>
    <div class="head_w">
        <div class="head_t clearfix">
            <div class="logo"><img src="~/images/logo.jpg"></div>
            <div class="rx_line"><img src="~/images/rx.jpg"></div>
        </div>
    </div>
    <div class="mainNav clearfix">
        <ul class="Nav_ul">
            <li><a href="/Home/Index">首页</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Route">旅游路线</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Scenic">旅游景点</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/CateringAccommodation">餐饮住宿</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Traffic_DatailsOne">交通线路</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Group">旅游团购</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Specialty">地方特产</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/AutoGenerationIntro">自动生成简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Team_Join">团队简介</a><img src="~/images/nav_line.jpg"></li>
            <li><a href="/Home/Itinerary_Details">行程导航</a></li>
        </ul>
    </div>
    <div class="b_wrap">
        <div class="current"><span>当前所在地：</span><a href="/Home/Index">首页</a>  >> <a href="/Home/User_Register">会员注册</a></div>
        <div class="regin_w clearfix">
            <div class="regin_con">
                <div class="regin">
                    <div class="tab_menu regin_menu">
                        <ul class="regin_ul">
                            <li class="selected" id="TelRegister">手机注册</li>
                            <li id="EmailRegister">邮箱注册</li>
                        </ul>
                    </div>
                    <div class="tab_box">
                        <div class="regin_tw">
                            <!-- 手机注册 -->
                            <table width="900" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="62">手机号码：</td>
                                    <td width="240"><input class="rg_in" id="User_Telphone" type="text" name="" value="" placeholder=""></td>
                                    <td>
                                        <span id="telInfo" style="margin-left:1%;color:gray">填写下手机号吧，方便我们联系您！</span>

                                    </td>
                                </tr>
                                <tr>
                                    <td>登录密码：</td>
                                    <td><input class="rg_in" id="User_Pwd" type="password" name="" value="" placeholder=""></td>
                                    <td><span id="passInfo" style="margin-left:1%;color:gray">请输入6位以上字符</span></td>
                                </tr>
                                <tr>
                                    <td>确认密码：</td>
                                    <td><input class="rg_in" id="User_RePwd" type="password" name="" value="" placeholder=""></td>
                                    <td><span id="repassInfo" style="margin-left:1%;color:gray">两次密码要输入一致哦</span></td>
                                </tr>
                                <tr>
                                    <td>验 证 码：</td>
                                    <td><input class="rg_yzm" id="Code" type="text" name="" value="" placeholder=""><button class="obtain" id="sendCode">获取短信验证码</button> @*<img src="~/images/yzm_zc.jpg"> <a href="#">看不清换一张</a>*@</td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td><input type="checkbox" name="" value=""> 愿意接受旅游资讯免费信息 </td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td><a href="#" id="User_Register"><img src="~/images/agree_b.jpg"></a></td>
                                </tr>
                            </table>
                            <div class="pdv_class" title="内容标题" style="width:650px;height:160px;z-index:12; overflow-y:auto;overflow-x:hidden;">
                                <div class="pdv_content" style="overflow:visible;width:100%;">
                                    <div class="pdv_border" style="margin:0;padding:0px;height:100%;">
                                        <div style="height:25px;margin:1px;display:none;background:;">

                                        </div>
                                        <div class="contentDetail">
                                            <div class="step0" style="display: block;">
                                                <p class="st_tit"><<中国梦想游会员协议>></p>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                                <div class="stp01">
                                                    <p>
                                                        一、服务条款
                                                        中国梦想游提供的服务将完全按照其发布的使用协议、服务条款和操作规则严格执行。为获得途牛服务，服务使用人（以下
                                                        称"会员"）应当同意本协议的全部条款并按照页面上的提示完成全部的注册程序。
                                                    </p>
                                                </div>
                                            </div>
                                        </div>
                                    </div>

                                </div>
                            </div>
                        </div>

                        <!-- 邮箱注册 -->
                        @*<div  class="mail_form form_adjust ">

                                    <div class="register_row placeholder7_p EmailRe">
                                        <input id="mail_account" type="text" class="mail_input placeholder7">
                                        <i class="reg_mail_icon mail_icon"></i>
                                        <div id="mail_account_errmsg">
                                            <div class="email_tips">邮箱地址将作为您的登录账号，还可以用于订单查询，找回密码！</div>
                                        </div>
                                    </div>
                                    <div class="register_row placeholder8_p EmailRe ">
                                        <input id="mail_password" type="password" class="placeholder8 check_password_strength">
                                        <i class="reg_phone_icon pwd_icon"></i>
                                        <div id="mail_password_msg">
                                        </div>
                                        <div id="mail_pwd_level" class="pwd_info pwd_info_adjust check_password_info" style="display: none;">
                                            <div class="pwd_level">
                                                <span class="sec_level">安全程度：</span>
                                                <div id="mail_pwd_level_bar" class="level_bar low_level">
                                                    <div class="level_bar_item sec_bar1"></div>
                                                    <div class="level_bar_item sec_bar2"></div>
                                                    <div class="level_bar_item sec_bar3"></div>
                                                </div>
                                                <span class="level_cn">低</span>
                                            </div>
                                            <p class="character_num">6-20个字符</p>
                                            <p class="character_format">只能包含字母、数字以及下划线</p>
                                        </div>
                                    </div>
                                    <div class="register_row placeholder9_p EmailRe">
                                        <input id="mail_password2" type="password" class="placeholder9">
                                        <i class="reg_phone_icon pwd_icon"></i>
                                        <div id="mail_password2_msg">
                                        </div>
                                    </div>

                            </div>*@

                        <!-- 邮箱注册 -->
                        <div class="hide regin_tw">
                            <table width="760" border="0" cellspacing="0" cellpadding="0">
                                <tr>
                                    <td width="62">邮箱地址：</td>
                                    <td><input class="rg_in" id="EmailAddress" type="text" name="" value="" placeholder=""><span id="EmailAddressInfo" style="color:gray;margin-left:2%">请填写邮箱地址!</span></td>
                                </tr>
                                <tr>
                                    <td>登录密码：</td>
                                    <td><input class="rg_in" id="EmailPwd" type="password" name="" value="" placeholder=""><span id="EmailPwdInfo" style="color:gray;margin-left:2%">请输入6-20个以上字符!</span></td>
                                </tr>
                                <tr>
                                    <td>确认密码：</td>
                                    <td><input class="rg_in" id="EmailRePwd" type="password" name="" value="" placeholder=""><span id="EmailRePwdInfo" style="color:gray;margin-left:2%">密码要输入一致哦!</span></td>
                                </tr>
                                <tr>
                                    <td>验 证 码：</td>
                                    <td><input class="rg_yzm" id="EmailCode" type="text" name="" value="" placeholder=""><button id="SendEmail">获取邮箱验证码</button></td>
                                </tr>
                                <tr>
                                    <td><button id="Email_Register" style="margin-left:99%;width:170%;background-color:#ff6700;color:white;border:none;border-radius:3px;padding:8%;margin-top:30%;font-size:14px">邮箱注册</button></td>
                                </tr>
                            </table>
                        </div>

                    </div>
                </div>
            </div>
            <div class="regin_info">
                <p class="if_t"><b>为什么选择中国梦想游</b></p>
                <div>
                    <div class="if_tit"><img src="~/images/dj_01.jpg"> 低价、放心</div>
                    <p>
                        低价保证、无零负团费、无特殊附加
                        费、9大出游保障。
                    </p>
                </div>
                <div>
                    <div class="if_tit"><img src="~/images/ff_01.jpg"> 产品丰富</div>
                    <p>
                        8万+旅游产品，涵盖跟团、自助、自
                        驾、邮轮、公司游等，总有一款适合您。
                    </p>
                </div>
                <div>
                    <div class="if_tit"><img src="~/images/xx_01.jpg"> 300万游客的选择</div>
                    <p>
                        累计服务300万人次，60万真实点评，
                        2万原创游记。
                    </p>
                </div>
                <div>
                    <div class="if_tit"><img src="~/images/fw_01.jpg"> 更多服务</div>
                    <p>全国15个出发城市，7X24小时服务</p>
                </div>
                <center><img src="~/images/zc_img0.jpg"></center>
            </div>
        </div>
    </div>
</body>
</html>
<script type="text/javascript">
    //消息弹出层
        Notiflix.Notify.Init();
			Notiflix.Report.Init();
			Notiflix.Confirm.Init();
    Notiflix.Loading.Init({
        clickToClose: true
    });

    //邮箱注册信息验证非空
    function CheckEmailInfoIsNull() {
        if ($("#EmailAddress").val() == "") {
            layer.msg('邮箱地址不能为空！', {
                title: '提示框',
                icon: 1,
            });
            return false;
        }
        if ($("#EmailPwd").val() == "") {
            layer.msg('密码不能为空！', {
                title: '提示框',
                icon: 1,
            });
            return false;
        }
        if ($("#EmailRePwd").val() == "") {
            layer.msg('确认密码不能为空！', {
                title: '提示框',
                icon: 1,
            });
            return false;
        }
        if ($("#EmailCode").val() == "") {
            layer.msg('验证码不能为空！', {
                title: '提示框',
                icon: 1,
            });
            return false;
        }
        return true;
    }


    //邮箱注册按钮点击事件
    $("#Email_Register").click(function () {
        //进行非空验证
        if (CheckEmailInfoIsNull()) {
            //检查验证码
            var data = {};
            data.Email = $("#EmailAddress").val();
            data.Code = $("#EmailCode").val();
            $.ajax({
                url: "/User/CheckEmailCode",
                type: "post",
                data: data,
                success: function (result) {
                    if (result.Success) {
                        //调用邮箱注册方法
                        EmailRegister();
                    }
                    else {
                        Notiflix.Notify.Warning('注册失败！请填入信息！');
                    }
                }
            });
        }
    });


    //邮箱注册方法
    function EmailRegister() {
        var data = {};
        data.User_Pwd = $("#EmailPwd").val();
        data.User_Email = $("#EmailAddress").val();
        $.ajax({
            url: "/User/AddUserEmailInfo",
            data: data,
            type: "post",
            success: function (result) {
                if (result.Success) {           
                    window.location.href = "/Home/User_Login";                                       
                }
                else {
                    Notiflix.Notify.Warning('邮箱注册失败！');
                }
            }
        });
    }

    //发送邮箱验证码方法
    function SendEmail() {
        //禁用
        $("#SendEmail").attr("disabled", "disabled");
        $("#SendEmail").css("background-color", "gray");
        var time = 60;
        $("#SendEmail").val(time + "S之后再发送");
        var timer = setInterval(function () {
            if (time > 0) {
                time--;
                $("#SendEmail").text(time + "S之后再发送");
            }
            else {
                $("#SendEmail").removeAttr("disabled").css("background-color", "#ff6700");
                $("#SendEmail").text("发送邮箱验证码");
                clearInterval(timer);
            }
        }, 1000);
    }


    //发送邮箱验证码按钮点击事件
    $("#SendEmail").click(function () {
        var email = $("#EmailAddress").val();
        $.ajax({
            url: "/User/SendEmailCode?email=" + email,
            type: "post",
            success: function (result) {
                if (result.Success) {
                    Notiflix.Notify.Success('发送成功,请查收！');                   
                    SendEmail();
                }
                else {
                    Notiflix.Notify.Warning('发送失败！');                 
                }
            }
        });
    });




    //检查邮箱格式
    function CheckEmail() {
        if ($.trim($('#EmailAddress').val()).length == 0) {
            $("#EmailAddressInfo").text("邮箱地址不能为空！");
            $("#EmailAddressInfo").css("color", "red");
            return false;
        }
        //验证邮箱
        if ($("#EmailAddress").val().match(/^[a-zA-Z0-9]{1}[\\.a-zA-Z0-9_-]*[a-zA-Z0-9]{1}@@[a-zA-Z0-9]+[-]{0,1}[a-zA-Z0-9]+[\\.]{1}[a-zA-Z]+[\\.]{0,1}[a-zA-Z]+$/)) {
            $("#EmailAddressInfo").text("√");
            $("#EmailAddressInfo").css({ "color": "green" });
            if (CheckUser_EmailNull()) {
                $("#EmailAddressInfo").text("√");
                $("#EmailAddressInfo").css("color", "green");
                return true;
            }
            else {
                return false;
            }
        }
        else {
            $("#EmailAddressInfo").text("邮箱格式不正确！");
            $("#EmailAddressInfo").css("color", "red");
            return false;
        }
    }


    //验证邮箱是否存在
    function CheckUser_EmailNull() {
        var data = {};
        data.User_Email = $("#EmailAddress").val();
        $.ajax({
            url: "/User/CheckUser_Email",
            data: data,
            type: "post",
            success: function (result) {
                if (result.Success) {
                    $("#EmailAddressInfo").text("邮箱已存在!");
                    $("#EmailAddressInfo").css("color", "red");
                    tel = false;
                }
                else {
                    $("#EmailAddressInfo").text("√");
                    $("#EmailAddressInfo").css("color", "green");
                    tel = true;
                }
            }
        })
        return tel;
    }


    //检查邮箱密码
    function CheckEmailPwd() {
        var EmailPwd = $("#EmailPwd").val();
        if (EmailPwd == "") {
            $("#EmailPwdInfo").text("密码不能为空!");
            $("#EmailPwdInfo").css("color", "red");
            return false;
        }
        var reg = /^(\w){6,20}$/;
        if (reg.test(EmailPwd)) {
            $("#EmailPwdInfo").text("√");
            $("#EmailPwdInfo").css("color", "green");
            return true;
        } else {
            $("#EmailPwdInfo").text("*只能输入6-20个字母、数字、下划线！");
            $("#EmailPwdInfo").css("color", "red");
            return false;
        }
    }

    //检查邮箱确认密码
    function CheckEmailRePwd() {
        var EmailPwd = $("#EmailPwd").val();
        var EmailRePwd = $("#EmailRePwd").val();
        if (EmailPwd == "") {
            $("#EmailRePwdInfo").text("确认密码不能为空！");
            $("#EmailRePwdInfo").css("color", "red");
            return false;
        }
        if (EmailRePwd != EmailPwd) {
            $("#EmailRePwdInfo").text("两次密码要一致哦！");
            $("#EmailRePwdInfo").css("color", "red");
            return false;
        } else {
            var reg = /^(\w){6,20}$/;
            if (reg.test(EmailRePwd)) {
                $("#EmailRePwdInfo").text("√");
                $("#EmailRePwdInfo").css("color", "green");
                return true;
            } else {
                $("#EmailRePwdInfo").text("*只能输入6-20个字母、数字、下划线！");
                $("#EmailRePwdInfo").css("color", "red");
                return false;
            }
        }
    }



    //用户密码
    var password = false;
    //用户确认密码
    var repassword = false;
    //手机号码
    var tel = false;
    //手机验证码
    var code = false;
    //邮箱地址
    var EmailAddress = false;
    //邮箱密码
    var EmailPwd = false;
    //邮箱确认密码
    var EmailRePwd = false;

    $(function () {
        //密码失去焦点事件
        $("#User_Pwd").blur(function () {
            password = CheckPassword1();
        });
        //确认密码失去焦点事件
        $("#User_RePwd").blur(function () {
            repassword = CheckPassword2();
        });
        //手机号码失去焦点事件
        $("#User_Telphone").blur(function () {
            tel = CheckUserTel();
        });
        //邮箱地址失去焦点事件
        $("#EmailAddress").blur(function () {
            EmailAddress = CheckEmail();
        });
        //邮箱密码失去焦点事件
        $("#EmailPwd").blur(function () {
            EmailPwd = CheckEmailPwd();
        });
        //邮箱确认密码失去焦点事件
        $("#EmailRePwd").blur(function () {
            EmailRePwd = CheckEmailRePwd();
        });



        //注册切换选择
        var wweya_li = $("div.tab_menu ul li");
        wweya_li.click(function () {
            $(this).addClass("selected")
                .siblings().removeClass("selected");
            var index = wweya_li.index(this);
            $("div.tab_box > div")
                .eq(index).show(100)
                .siblings().hide();
        }).hover(function () {
            $(this).addClass("hover");
        }, function () {
            $(this).removeClass("hover");
        });


        //手机注册方法
        function Register() {
            if (password && repassword) {
                var data = {};
                data.User_Pwd = $("#User_Pwd").val();
                data.User_Telphone = $("#User_Telphone").val();
                $.ajax({
                    url: "/User/AddUserInfo",
                    data: data,
                    type: "post",
                    success: function (result) {
                        if (result.Success) {                          
                             window.location.href = "/Home/User_Login";                                    
                        }
                        else {
                             Notiflix.Notify.Warning('注册失败！');                                 
                        }
                    }
                });
            }
        }


        //手机注册按钮点击事件
        $("#User_Register").click(function () {
            //检查验证码
            var data = {};
            data.TelPhone = $("#User_Telphone").val();
            data.Code = $("#Code").val();
            $.ajax({
                url: "/User/CheckCodeRegister",
                type: "post",
                data: data,
                success: function (result) {
                    if (result.Success) {
                        //调用注册方法
                        Register();
                    }
                    else {
                         Notiflix.Notify.Warning('注册失败！请填入信息！');                         
                    }
                }
            });
        });


        //发送手机验证码按钮触发事件
        $("#sendCode").click(function () {
            if (tel) {
                var telphone = $("#User_Telphone").val();
                $.ajax({
                    url: "/User/AddSmsInfoRegister?tel=" + telphone,
                    type: "post",
                    success: function (result) {
                        if (result.Success) {
                            Notiflix.Notify.Success('发送成功!');                        
                            SendCode();
                        }
                        else {
                             Notiflix.Notify.Warning('发送失败！');                              
                        }
                    }
                })
            }
        });


        //发送手机验证码方法
        function SendCode() {
            //禁用
            $("#sendCode").attr("disabled", "disabled");
            $("#sendCode").css("background-color", "gray");
            var time = 60;
            $("#sendCode").val(time + "S之后再发送");
            var timer = setInterval(function () {
                if (time > 0) {
                    time--;
                    $("#sendCode").text(time + "S之后再发送");
                }
                else {
                    $("#sendCode").removeAttr("disabled").css("background-color", "#ff6700");
                    $("#sendCode").text("发送验证码");
                    clearInterval(timer);
                }
            }, 1000);
        }


        //验证手机号是否存在
        function CheckUserTelNull() {
            var data = {};
            data.User_Telphone = $("#User_Telphone").val();
            $.ajax({
                url: "/User/CheckUserTel",
                data: data,
                type: "post",
                success: function (result) {
                    if (result.Success) {
                        $("#telInfo").text("手机号已存在!");
                        $("#telInfo").css("color", "red");
                        tel = false;
                    }
                    else {
                        $("#telInfo").text("√");
                        $("#telInfo").css("color", "green");
                        tel = true;
                    }
                }
            })
            return tel;
        }


        //检查用户密码
        function CheckPassword1() {
            var User_Pwd = $("#User_Pwd").val();
            if (User_Pwd == "") {
                $("#passInfo").text("密码不能为空!");
                $("#passInfo").css("color", "red");
                return false;
            }
            var reg = /^(\w){6,20}$/;
            if (reg.test(User_Pwd)) {
                $("#passInfo").text("√");
                $("#passInfo").css("color", "green");
                return true;
            } else {
                $("#passInfo").text("*只能输入6-20个字母、数字、下划线！");
                $("#passInfo").css("color", "red");
                return false;
            }
        }

        //检查用户确认密码
        function CheckPassword2() {
            var password1 = $("#User_Pwd").val();
            var password2 = $("#User_RePwd").val();
            if (password1 == "") {
                $("#repassInfo").text("确认密码不能为空！");
                $("#repassInfo").css("color", "red");
                return false;
            }
            if (password2 != password1) {
                $("#repassInfo").text("两次密码要一致哦！");
                $("#repassInfo").css("color", "red");
                return false;
            } else {
                var reg = /^(\w){6,20}$/;
                if (reg.test(password2)) {
                    $("#repassInfo").text("√");
                    $("#repassInfo").css("color", "green");
                    return true;
                } else {
                    $("#repassInfo").text("*只能输入6-20个字母、数字、下划线！");
                    $("#repassInfo").css("color", "red");
                    return false;
                }
            }
        }

        //检查手机号11位
        function CheckUserTel() {
            var tel = $("#User_Telphone").val();
            if (tel == "") {
                $("#telInfo").text("手机号不能为空！");
                $("#telInfo").css("color", "red");
                return false;
            }
            var reg = /^1([38]\d|5[0-35-9]|7[3678])\d{8}$/;
            if (reg.test(tel)) {
                $("#telInfo").text("√");
                $("#telInfo").css("color", "green");
                if (CheckUserTelNull()) {
                    $("#telInfo").text("√");
                    $("#telInfo").css("color", "green");
                    return true;
                }
                else {
                    return false;
                }
            } else {
                $("#telInfo").text("手机号必须为11位1");
                $("#telInfo").css("color", "red");
                return false;
            }
        }

    });
</script>

